import { createRouter, createWebHashHistory, createWebHistory } from "vue-router";

import User from "../pages/User.vue";
import Book from "../pages/Book.vue";

import Info from "../pages/user/Info.vue";
import Update from "../pages/user/Update.vue";

import List from "../pages/book/List.vue";
import AddBook from "../pages/book/AddBook.vue";

const routes = [
    {
        path: "/user", component: User,
        children: [
            { path: "info", component: Info },
            { path: "update", component: Update }
        ]
    },
    {
        path: "/book", component: Book,
        children: [
            { path: "list", component: List },
            { path: "addBook", component: AddBook }
        ]
    }
];

const router = createRouter({
    history: createWebHistory(), // #
    routes
})

export default router;